package com.hitcoder.chat.utils

import android.app.Activity
import android.content.Context
import android.widget.Toast
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.StaggeredGridLayoutManager
import com.hitcoder.chat.R
import com.hitcoder.chat.model.AppBean


const val PRINT_STACK_TRACE = "PrintStackTrace"

var mAppBeanList = arrayListOf(
    AppBean(0, R.string.chat_fun_album, "相册"),
    AppBean(1, R.string.chat_fun_capture, "拍摄"),
    AppBean(2, R.string.chat_fun_telephone, "电话会议", false),
    AppBean(3, R.string.chat_fun_location, "位置"),
    AppBean(4, R.string.chat_fun_file, "文件")
)


fun Float.dip2px(context: Context): Int {
    val scale = context.resources.displayMetrics.density
    return (this * scale + 0.5f).toInt()
}


fun Activity.toast(msg: String) {
    Toast.makeText(this, msg, Toast.LENGTH_SHORT).show()
}